// SelectionHandler.h: interface for the CSelectionHandler class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SELECTIONHANDLER_H__32F12D8D_DC33_498A_A86F_071CE873EA1C__INCLUDED_)
#define AFX_SELECTIONHANDLER_H__32F12D8D_DC33_498A_A86F_071CE873EA1C__INCLUDED_

#include "IVirtualMouseEvents.h"

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CAnsiTerminalView;

class CSelectionHandler : public IVirtualMouseEvents
{
protected:
	CAnsiTerminalView *m_pView;
	CPoint m_ptDownCell;
	CPoint m_ptMoveCell;

	BOOL m_bSelecting;
	BOOL m_bSelected;
	BOOL m_bBlockSelect;
	BOOL m_bCancelingSelection;
	void UpdateSelection();

public:
	virtual BOOL OnMouseDown(CPoint ptCell, UINT nFlags);
	virtual BOOL OnMouseMove(CPoint ptCell, UINT nFlags);
	virtual BOOL OnMouseUp(CPoint ptCell, UINT nFlags);

	virtual BOOL OnMouseWheel(CPoint ptCell, UINT nFlags, short wheelNotches);
	virtual BOOL OnFreezeMouse(BOOL bFreeze);

	BOOL IsSelected();

public:
	CSelectionHandler(CAnsiTerminalView *pView);
};

#endif // !defined(AFX_SELECTIONHANDLER_H__32F12D8D_DC33_498A_A86F_071CE873EA1C__INCLUDED_)
